import { defHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';

enum Api {
  fileconfiglist = '/admin-api/infra/file-config/page',
  updateFileConfigMaster = '/admin-api/infra/file-config/update-master',
  testfileconfig = '/admin-api/infra/file-config/test',
  deletefileconfig = '/admin-api/infra/file-config/delete',
  createFileConfig = '/admin-api/infra/file-config/create',
  getFileConfig = '/admin-api/infra/file-config/get',
  updateFileConfig = '/admin-api/infra/file-config/update',
}

/**
 * @description: 文件
 */
export const getFileConfigList = (params: any) => {
  return defHttp.get<any>({ url: Api.fileconfiglist, params });
};
export const deleteFileConfig = (params: any) => {
  return defHttp.delete<any>({
    url: Api.deletefileconfig,
    params,
    headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
  });
};
export const updateFileConfigMaster = (params: any) => {
  return defHttp.put<any>({ url: Api.updateFileConfigMaster, params }, { joinParamsToUrl: true });
};
export const testFileConfig = (params: any) => {
  return defHttp.get<any>({ url: Api.testfileconfig, params });
};
export const createFileConfig = (params: any) => {
  return defHttp.post<any>({ url: Api.createFileConfig, params });
};
export const getFileConfig = (params: any) => {
  return defHttp.get<any>({ url: Api.getFileConfig, params });
};
export const updateFileConfig = (params: any) => {
  return defHttp.put<any>({ url: Api.updateFileConfig, params });
};
